import Vue from 'vue'
import VueRouter from "vue-router";
import Home from '@/view/layout.vue';
import Detail from '@/view/detail.vue';
// 引入二级路由
import Index from '@/view/index';
import Find from '@/view/find';
import New from '@/view/new';
import My from '@/view/my'
Vue.use(VueRouter)

const router = new VueRouter({
  routes: [
    {
      path:'/home',
      component:Home,
      children:[
        {
          path:'index',
          component:Index
        },
        {
          path:'find',
          component:Find
        },
        {
          path:'new',
          component:New
        },{
          path:'my',
          component:My
        }
      ]
    },
    {
      path:'/detail',
      component:Detail
    }
  ]
})

export default router